from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from web_app.models import UserUrl, UserUrlAdvert, UserProfile


class UserProfileInline(admin.StackedInline):
    model = UserProfile
    can_delete = False
    verbose_name_plural = 'employee'


class UserAdmin(UserAdmin):
    inlines = (UserProfileInline, )


class UserUrlAdmin(admin.ModelAdmin):
    """Social Auth user options"""
    list_display = ('user', 'url')


class UserUrlAdvertAdmin(admin.ModelAdmin):
    """Social Auth user options"""
    list_display = ('user_url', 'advert_id', 'advert_price', 'processed')


class UserProfileAdmin(admin.ModelAdmin):
    """Social Auth user options"""
    list_display = ('user', 'calendar_id')

admin.site.register(UserProfile, UserProfileAdmin)
admin.site.register(UserUrl, UserUrlAdmin)
admin.site.register(UserUrlAdvert, UserUrlAdvertAdmin)
admin.site.unregister(User)
admin.site.register(User, UserAdmin)